<template>
	<div class="wrap">
    <div class="wrap_content">
      <div class="title">感謝您的訂購，#order no已經確認</div>
      <div class="content">
        <div class="content_title">{{list.order.orderSn}} <span>訂單詳情</span></div>
        <div class="con_con">
          <div>
            <div>由</div>
            <div>幸福滋味 Home yasty</div>
            <div>香港 銅鑼灣登龍接單18號v-POINT21樓</div>
            <div>電話+852 113263511</div>
            <div>郵箱:{{list.sysEmail}}</div>
          </div>
          <div>
            <div>至</div>
            <div>{{list.order.consignee}}</div>
            <div>{{list.order.address}}</div>
            <div>電話+ {{list.order.mobile}}</div>
            <div>郵箱:{{list.userEmail}}</div>
          </div>
          <div>
            <div>參看編號</div>
            <div>#{{list.order.orderSn}}</div>
            <div>付款日期</div>
            <div>{{list.order.payTime}}</div>
          </div>
        </div>
      </div>
      <div class="goodtable">
        <el-table :data="list.orderGoods" style="width: 100%"   ref="singleTable" :header-cell-style="tableHeaderColor">
          <el-table-column label="數量" align="center" width="150">
            <template slot-scope="scope">
              <div class="allPrice">{{scope.row.number}}</div>
            </template>
          </el-table-column>
          <el-table-column label="商品編號" align="center" width="200">
              <template slot-scope="scope">{{scope.row.goodsSn}}</template>
          </el-table-column>
          <el-table-column label="商品" align="center" width="200">
              <template slot-scope="scope">{{scope.row.goodsName}}</template>
          </el-table-column>
          <el-table-column label="單價（HKS）" align="center" width="200">
              <template slot-scope="scope">HK${{scope.row.price}}</template>
          </el-table-column>
          <el-table-column label="商品小計（HKS）" align="center" width="300">
              <template slot-scope="scope">HK${{scope.row.price * scope.row.number}}</template>
          </el-table-column>
        </el-table>
      </div>
      <div class="paymethod">
        <div>
          <div>付款方式</div>
          <div>paypal</div>
        </div>
        <div>
          <div>付款日期</div>
          <div>{{list.order.payTime}}</div>
        </div>
      </div>
      <div class="payaddress">
        <div>送貨地址</div>
        <div>{{list.order.address}}</div>
      </div>
      <div class="settlement">
        <div class="settlement_top">
          <div class="settlement_item">
            <div>{{list.orderGoods.length}}件商品，總商品金額：</div>
            <div>${{list.order.goodsPrice}}</div>
          </div>
          <div class="settlement_item">
            <div>小計：</div>
            <div>${{list.order.goodsPrice}}</div>
          </div>
          <div class="settlement_item">
            <div>運費：</div>
            <div>${{list.order.freightPrice}}</div>
          </div>
          <div class="settlement_item">
            <div>折扣：</div>
            <div>-$0</div>
          </div>
          <div class="settlement_item">
            <div>優惠碼：</div>
            <div>-${{list.order.promoCodePrice}}</div>
          </div>
          <div class="settlement_item">
            <div>優惠券：</div>
            <div>-${{list.order.couponPrice}}</div>
          </div>
          <div class="settlement_item">
            <div>總金額：</div>
            <div class="itotal_price">${{list.order.goodsPrice}}</div>
          </div>
        </div>  
      </div>
    </div>
	</div>  	
</template>

<script>
	import {success} from '@/api/order';
  import { getToken } from '@/utils/auth' 
	export default {
		name: 'settleorder',
	  data() {
			return {
        gooddata:[
          {num:1,numno:'Testing',price:1},
          {num:1,numno:'Testing',price:1},
        ],
        orderno:'',
        list:{
          order:{
            orderSn:''
          },
          userEmail:'',
          AccountNumber:'',
          sysEmail:''
        }
			}
		},
		computed:{
			
    },
    mounted(){
      this.orderno = this.$route.query.orderSn
       success({userId:getToken(),orderSn:this.$route.query.orderSn,payType:1}).then(response => {
            console.log(response.data)
            this.list = response.data
        })
    },
		methods: {
			//設置表格行的樣式
      tableRowStyle({row,rowIndex}){
          return 'background-color:#D6D6D6;;font-size:24px;height:75px;line-height:75px'
      },
      //設置表頭行的樣式
      tableHeaderColor({row,column,rowIndex,columnIndex}){
        return 'background-color:#fff;text-align:center;height:40px;font-size: 24px;font-weight: bolder;color: #000;line-height: 40px;'
      },
	  }
	}
</script>

<style scoped>
	.wrap{
    width: 100%;
    min-height: 80vh;
    box-sizing: border-box;
    background: #fff;
    padding-top: 30px;
    border-top: 5px solid #f5f5f5;
  }
  .wrap_content{
    width: 70%;
    margin: 0px auto;
    box-sizing: border-box;
  }
  .title{
    font-size: 40px;
    font-weight: bold;
    color: #333333;
    line-height: 40px;
    text-align: center;
  }
  .content{
    width: 100%;
    box-sizing: border-box;
    margin-top: 60px;
  }
  .content_title{
    width: 300px;
    font-size: 28px;
    font-weight: 400;
    color: #333333;
    line-height: 30px;
  }
  .con_con{
    border-top: 1px solid #999999;
    border-bottom: 1px solid #999999;
    margin: 20px 0px;
    box-sizing: border-box;
    padding: 20px 10px;
  }
  .con_con{
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
  }
  .con_con>div{
    font-size: 16px;
    font-weight: 300;
    color: #333333;
    line-height: 30px;
  }
  .goodtable>>>.el-table__row{
    line-height: 75px !important;
    height: 75px !important;
    background: #D6D6D6 !important;
  }
  .paymethod{
    display: flex;
    align-items: center;
    box-sizing: border-box;
    margin-top: 50px;
  }
  .paymethod>div{
    width:50%;
    box-sizing:border-box;
  }
  .paymethod>div>div:nth-child(1){
    height: 40px;
    font-size: 30px;
    font-weight: 400;
    color: #333333;
    line-height: 40px;
  }
  .paymethod>div>div:nth-child(2){
    height: 33px;
    font-size: 20px;
    font-weight: 400;
    color: #999999;
    line-height: 33px;
    margin-top: 20px;
  }
  .payaddress{
    box-sizing: border-box;
    margin-top: 40px;
  }
  .payaddress>div:nth-child(1){
    height: 40px;
    font-size: 30px;
    font-weight: 400;
    color: #333333;
    line-height: 40px;
  }
  .payaddress>div:nth-child(2){
    height: 33px;
    font-size: 20px;
    font-weight: 400;
    color: #999999;
    line-height: 33px;
    margin-top: 20px;
  }
  /* 結算內容 */
  .settlement{
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid  #999999;
    border-top: 1px solid  #999999;
    padding:20px;
    margin-top: 20px;
  }
  .settlement_top{
    width: 100%;
    padding: 30px;
    background: white;
    box-sizing: border-box;
  }
  .settlement_item{
    display: flex;
    align-items: center;
    box-sizing: border-box;
    font-size: 18px;
    font-weight: bold;
    color: #000000;
    line-height: 28px;
    justify-content: space-between;
  }
  .settlement_item>div:nth-child(1){
    text-align: right;
    width: 90%;
  }
  .settlement_item>div:nth-child(2){
    width: 10%;
    text-align: right;
  }
  .itotal_price{
    color:#E2231A
  }
</style>